package com.czy.ekp.gen;


import lombok.Data;
import java.util.ArrayList;
import java.util.List;

@Data
public class ModuleVo implements Cloneable{

    String moduleName;

    List<FieldVo> fields;

    FieldVo keyField;


    @Override
    protected ModuleVo clone() {

        ModuleVo tmp = new ModuleVo();
        tmp.setModuleName(moduleName);
        try{
            if(fields != null && fields.size() > 0){
                List<FieldVo> list = new ArrayList<>();
                for(FieldVo fieldVo : fields){
                    list.add(fieldVo.clone());
                }
                tmp.setFields(list);
            }

            if(keyField != null){
                tmp.setKeyField(keyField.clone());
            }
        }catch (Exception e){
            e.printStackTrace();
        }

        return tmp;

    }


}
